home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / DTS.Chat / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.9 KB  |  86 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        Start.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1989-1991 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  18. #include "App.Common.h"        /* Get the stuff in common with rez.            */
  19. #include "App.protos.h"        /* Get the prototypes for application.            */
  20.  
  21. #ifndef __TOOLUTILS__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25.  
  26.  
  27. /*****************************************************************************/
  28.  
  29.  
  30.  
  31. #ifndef THINK_C
  32. extern void _DataInit();
  33. #endif
  34.  
  35.  
  36.  
  37. /*****************************************************************************/
  38. /*****************************************************************************/
  39.  
  40.  
  41.  
  42. #pragma segment Main
  43. void    main(void)
  44. {
  45.     NamesTableEntry    appNTE;
  46.     EntityName        appEntityName;
  47.     OSErr            atErr;
  48.  
  49. #ifndef THINK_C
  50.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  51. #endif
  52.  
  53.     SetApplLimit(GetApplLimit() - 16384);
  54.         /* This decreases the application heap by 16k, which in turn
  55.         ** increases the stack by 16k. */
  56.  
  57.     MaxApplZone();                    /* Expand the heap so code segments load at the top. */
  58.  
  59.     Initialize(1, kMinHeap, kMinSpace, nil, nil);    /* Initialize the program. */
  60.  
  61.     DoSetResCursor(watchCursor);                    /* Rest of startup may take a while. */
  62.  
  63.     ATInit();
  64.     InitRequiredAppleEvents();
  65.     InitConnectAppleEvents();
  66.     InitCustomAppleEvents();
  67.  
  68.     DoAdjustMenus();
  69.  
  70.     StartDocuments();                /* Open (or print) designated documents. */
  71.  
  72.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  73.  
  74.     atErr = AddPPCNBPAlias(&appNTE, "\pDTS.Chat", &appEntityName);
  75.         /* It is okay to use a constant string ID here, as this is never seen by the user. */
  76.  
  77.     EventLoop();                    /* Call the main event loop. */
  78.  
  79.     if (!atErr) RemoveNBPAlias(&appEntityName);
  80.  
  81.     ExitToShell();                    /* Quit the application. */
  82. }
  83.  
  84.  
  85.  
  86.